package com.ctsi.security;

import com.ctsi.commons.util.response.Page;
import com.ctsi.security.domain.SRole;
import com.ctsi.security.domain.SRoleUser;

import java.util.List;

public interface PermissionRole {
	public List<SRole> getModuleTypeRoles(String moduleType, String secondModuleType);
	/**
	 * 根据角色ID列表查询符合条件的权限角色对象列表
	 * 
	 * @param roleIds
	 * @return
	 */
	public List<SRole> findSRoleByIds(List<String> roleIds);

	/**
	 * 查询全部角色信息
	 * 
	 * @return
	 */
	public List<SRole> findRoleAll();
	/**
	 * 增加用户角色（可多个角色，","分割）
	 * 
	 * @param loginId
	 * @param loginName
	 * @param roleIds
	 */
	public void addUserRoles(String loginId, String loginName, String partyId, String roleIds);
	
	public abstract void addRole(SRole role);

	public abstract void updRole(SRole role);

	public abstract void remRole(List<String> list);
	public abstract Page queryRoleUser(int pageSize, int startIndex,
									   String roleId, String userLoginId, String userLoginName,String curLoginId);


	public abstract void remRoleUser(String partyId, String loginId,
                                     boolean joinWay, String roleId);

	public abstract void remRoleOrganAndUserGroup(String partyId,
                                                  boolean joinWay, String roleId);

	public abstract void remRoleAllOrganAndUserGroup(String partyId,
                                                     String roleId, String type);

	public abstract SRole findSRoleById(String roleId);

	public abstract List<String> findRoleUserLoginId(String[] field,
                                                     Object[] args);

	public abstract boolean valRoleName(String roleName);

	
	public abstract int saveOrganAndUserGroup(String roleId, String type,
                                              String[] arrayPartyId, String[] arrayLoginName);

	public abstract List<Integer> saveOrganAndUserGroup(String type,
                                                        String[] arrayPartyId, String[] arrayLoginName, String roleId);
	
	public abstract int delSRoleUser(String[] arrayRoleUserId,
                                     String[] arrayLoginId, String[] arrayPartyId, String[] arrayType,
                                     String roleId);


	public abstract int saveAllRoleUser(String roleId, String[] arrayLoginId,
                                        String[] arrayLoginName, String[] arrayParty);


	public abstract List<Integer> saveAllRoleUser(String[] arrayLoginId,
                                                  String[] arrayLoginName, String[] arrayParty, String roleId);


	public abstract List<Integer> saveAllRoleUserWithLoginId(
            String[] arrayLoginId, String[] arrayLoginName,
            String[] arrayParty, String roleId);


	public abstract List<String> getRoleIdsByPartyId(String partyId);


	public abstract void delUserRoles(String loginId, String roleIds);


	public abstract void delUserRole(String loginId, String roleId);


	public abstract void addUserRole(String loginId, String loginName,
                                     String partyId, String roleId);


	public abstract void addSRoleMem(SRole role, String loginUserIds,
                                     String loginNames, String partyIds, String organIds,
                                     String organNames, String groupIds, String groupNames);


	public abstract List<SRole> getSonRoles(String parentRoleId);


	public abstract List<SRole> getSonRoles(String parentRoleId, String loginId);



	public abstract List<SRole> getModuleTypeRoles(String moduleType);


	public abstract List<SRole> getDesRoles(String roleId);


	public abstract String getDataObjectType();
		public abstract void addRoleUserGroup(String roleId, SRoleUser insertRoleUser);

	public void addRoleOrgan(String roleId, SRoleUser sroleUser, boolean joinWay, String type);
	
	public abstract void addRoleOrganAndUser(String roleId, List<SRoleUser> listOrgan, List<SRoleUser> listUser, String type);
	
	public abstract List<SRoleUser> findRoleUser(String[] field, Object[] args);
	
	public void refresh(String roleId);
	
	public void addRoleUser(String roleId, SRoleUser sroleUser, boolean joinWay);
	
	public void updateSoleUserNameByPaytyId(SRoleUser sroleUser);
	
	public void setJoinWay(boolean joinWay, SRoleUser sroleUser);
	
}

